

import MaterialProperty from '../../MaterialProperty'

/**
 * 圆心渐变墙体2  用于省份渐变色
 */

export default class FloodWallMaterialProperty extends MaterialProperty {
  constructor(options = {}) {
    super(options)
    this.diffusePower = options.diffusePower || 1.
    this.alphaPower = options.alphaPower || 1.
  }

  // 获取类型
  getType(time) {
    return Cesium.Material.FloodWallMaterialType
  }

  getValue(time, result) {
    if (!result) {
      result = {}
    }
    result.color = Cesium.Property.getValueOrUndefined(this.color, time)
    result.diffusePower = Cesium.Property.getValueOrUndefined(this.diffusePower, time)
    result.alphaPower = Cesium.Property.getValueOrUndefined(this.alphaPower, time)
    return result
  }

  equals(other) {
    return this === other
  }
}

Object.defineProperties(FloodWallMaterialProperty.prototype, {
  color: Cesium.createPropertyDescriptor('color'),
  diffusePower: Cesium.createPropertyDescriptor('diffusePower'),
  alphaPower: Cesium.createPropertyDescriptor('alphaPower')
})

